package unit7;

public class Test3 {

	public static void main(String[] args) {
		//int[] arr= {89,92,75,85,95};
		int[] arr=new int[5];
		arr[0]=89;
		arr[1]=92;
		arr[2]=75;
		arr[3]=85;
		arr[4]=95;
		int sum=0;
		double avg=0;
		int max=arr[0];
		int min=arr[0];
		for(int i=0;i<=arr.length-1;i++) {
			sum+=arr[i];
			if (max<arr[i]) {
				max=arr[i];
			}if (min>arr[i]) {
				min=arr[i];
			}
		}
			System.out.println("总和"+sum);		
			avg=(sum*1.0)/arr.length;
			System.out.println("平均分："+avg);
			
		

	}

}
